#pragma once

#include <math.h>
#include <ctime>
#include <cstdlib>
#include <list>
#include <sstream>

#include "header.h"
using namespace std;

namespace cgMath
{
	//class cgVector2D;

	int RandomNumOfTwo(int firstNum, int secondNum);
	int RandomInt();

	float RandomFloatBetween(float startNum, float endNum);

	int RandomIntBetween(int startNum, int endNum);

	int RandomIntOutOfList(std::list<int> inIntList);

	void RandomVector2DBetween(
		cgVector2D& outVect,
		cgVector2D& startVect, 
		cgVector2D& endVect);


	float Vector2DLength(const cgVector2D& _inVector2D);
	float Vector2DDist(const cgVector2D& _startPos, const cgVector2D& _endPos);
	cgMath::cgVector2D RandomMapPosition();
	
	cgMath::cgVector2D PosToGrid(cgMath::cgVector2D pos);
	void ChangeToNearestGridPos(cgMath::cgVector2D& pos);

	float CalcVectorAngle(float x1, float z1, float x2, float z2);

	float Vector2DAngle(const cgMath::cgVector2D& src, const cgMath::cgVector2D& dst);
	void Vecter2DRotate(cgVector2D& output, cgVector2D& input, float angle);


	std::string FloatToString (float val);
}
